﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Samples_TestTemplate : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        this.dotNetFlexGrid1.InitConfig(
            new string[]{
                "showth=false",//隐藏表头
                "title=false",//标题
                "singleselected=false",//是否单选
                "resizable=true",//是否可以调整大小
                "usepager=true",//使用分页器
                "showcheckbox=true",//显示复选框
                "height=auto",//高度，可为auto或具体px值
                "width=auto",//宽度，可为auto或具体px值
                "striped=true",//是否显示行交替色
                "selectedonclick=true"//是否点击行自动选中checkbox
            },
            new dotNetFlexGrid.FieldConfig[]{
                new dotNetFlexGrid.FieldConfig("Guid","编号",60,true,dotNetFlexGrid.FieldConfigAlign.Left,false,true,true),
                new dotNetFlexGrid.FieldConfig("String1","字段1",100,true,dotNetFlexGrid.FieldConfigAlign.Right,false,false,true,"<input id='String1_[@Guid]' type='button' value='[@String1]' />"),
                new dotNetFlexGrid.FieldConfig("String2","字段2",100,true,dotNetFlexGrid.FieldConfigAlign.Left,false,false,true,"<input id='String2_[@Guid]' type='text' value='[@String2]' />"),
                new dotNetFlexGrid.FieldConfig("String3","字段3",100,true,dotNetFlexGrid.FieldConfigAlign.Left,false,false,true,"<input id='String3_[@Guid]' type='password' value='[@String3]' />"),
                new dotNetFlexGrid.FieldConfig("String4","字段4",100,true,dotNetFlexGrid.FieldConfigAlign.Left,false,false,true,"<area>[@String4]</area>"),
                new dotNetFlexGrid.FieldConfig("Int1","字段5",100,true,dotNetFlexGrid.FieldConfigAlign.Left,false,false,true,"<a href='[@Int1]'>[@Guid]</a>"),
                new dotNetFlexGrid.FieldConfig("Int2","字段6",100,true,dotNetFlexGrid.FieldConfigAlign.Left,false,false,true,"<input id='Int2_[@Guid]' type='radio' value='[@Int2]' />"),
                new dotNetFlexGrid.FieldConfig("DateTime","字段7",100,true,dotNetFlexGrid.FieldConfigAlign.Left,false,false,true,"<img src='http://www.cnblogs.com/images/logo_small.gif?[@Guid]'> time is [@DateTime] "),
                new dotNetFlexGrid.FieldConfig("Checked","字段8",60,false,dotNetFlexGrid.FieldConfigAlign.Left,true,true,false)
            },
            null,
            null

            );
        this.dotNetFlexGrid1.DataHandler = new dotNetFlexGrid.DataHandlerDelegate(DotNetFlexGrid1DataHandler);//绑定方法必须是public的
    }
    public dotNetFlexGrid.DataHandlerResult DotNetFlexGrid1DataHandler(dotNetFlexGrid.DataHandlerParams p)
    {
        return dotNetFlexGrid.DemoDataHandler(p);
    }
}
